package Database;

import java.util.*;

//Klase eilutes informacijos laikymui
public class Row {
	private List<RowBox> row = new ArrayList<RowBox>();
	
	//Priskiria stulpeliui kazkokia reiksme
	public void insertValue(String columnName, String value) {
		RowBox box = new RowBox(columnName, value);
		
		row.add(box);
	}
	
	//Grazina reiksme stulpeliui
	public String getColumnValue(String columnName) {
	String columnValueNew = null;
	
		for (int i = 0; i < row.size(); i++) {
			//System.out.println(row.get(i).getColumnName()+"=="+columnName);
			
			if (row.get(i).getColumnName().equals(columnName)) {
				columnValueNew = row.get(i).getValue();
				break;
			}
		}
		
		return columnValueNew;
	}
	
	//grazina eilutes ilgi
	public int size() {
		return row.size();
	}
}